package SQL.Spring.SpringJDBC.Module;

import SQL.Spring.SpringJDBC.DAO.CustomerDAO;
import SQL.Spring.SpringJDBC.Entity.Customer;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.Random;

/**
 * Created by kz on 2017/5/14.
 */
public class App {
    public static void main( String[] args )
    {
        ApplicationContext context =
                new ClassPathXmlApplicationContext(new String[] {"SpringConfigs/Spring-Module.xml"});

        CustomerDAO customerDAO = (CustomerDAO) context.getBean("JdbcCustomerDAO");
        Customer customer = new Customer(1 , "kz2",32);

//        customerDAO.insert(customer);

        Customer customer1 = customerDAO.findByCustomerId(1);
        System.out.println(customer1.asString());

    }
}
